package com.framework.base.action;

import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ServletActionContext;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * @author LIN
 * @date 2021-05-08
 */
public class BaseAction extends ActionSupport {

    private HttpSession session;
    private HttpServletResponse response;
    private HttpServletRequest request;

    protected HttpServletResponse getResponse(){
        return ServletActionContext.getResponse();
    }

    public void setResponse(HttpServletResponse response){
        this.response = response;
    }
    protected HttpServletRequest getRequest(){
        return ServletActionContext.getRequest();
    }
    public void setRequest(HttpServletRequest request){
        try{
            request.setCharacterEncoding("UTF-8");
        }catch(Exception e){
            e.printStackTrace();
        }finally{

        }
        this.request = request;
    }



}
